import { defineStore } from "pinia";
import { ref, computed, onMounted } from "vue";

export const useBillStore = defineStore("userBillStore", () => {
  // 所有订单列表
  const billData = ref([]);
  // 添加订单
  const addBillData = async (item, orderStatus) => {
    // console.log("添加账单数据:", item);
    billData.value.push({
      //订单号
      OrderNumber: Date.now(),
      // 商品数据
      goodsData: item,
      // 订单状态
      status: orderStatus,
    });
  };
  return {
    billData,
    addBillData,
  };
});
